<template>
    <div class="bg">
      <div class="login">
        <div class="login-bg"></div>
        <div class="login-body">
          <div class="login-title">教师登录</div>
          <Form ref="formInline" :model="formInline" :rules="ruleInline" class="login-form">
            <FormItem prop="user" class="userbody">
              <span class="user">
                <Icon type="md-person" class="usericon"/>
              </span>
              <Input class="userinputs" type="text" v-model="formInline.user" placeholder="请输入用户名"/>
            </FormItem>
            <FormItem prop="password" class="passwordbody">
              <span class="password">
                <Icon type="md-lock" class="passwordicon"/>
              </span>
              <Input class="passwordinputs" type="password" v-model="formInline.password" placeholder="请输入密码"/>
            </FormItem>
            <FormItem>
              <div class="ivu-form-item-content">
                <label>
                  <Checkbox class="remember">记住我</Checkbox>
                </label>
              </div>
            </FormItem>
            <FormItem>
              <Button type="primary" @click="handleSubmit('formInline')" class="loginbtn">登录</Button>
            </FormItem>
            <FormItem>
              <div class="ivu-form-item-content">
                <label>
                  <Checkbox class="ty">我已同意《伯乐码用户协议》</Checkbox>
                </label>
              </div>
            </FormItem>
            <FormItem>
              <div class="form">
                <span>推荐浏览器：</span>
                <div class="google">
                  <img src="../assets/image/google.png"/>
                  <span>谷歌</span>
                </div>
                <div class="firefox">
                  <img src="../assets/image/火狐.png"/>
                  <span>火狐</span>
                </div>
              </div>
            </FormItem>
          </Form>
        </div>
      </div>
      <div class="version">版权所有 © 2016-2020 上海践升信息科技有限公司 沪ICP备19006290号-3</div>
    </div>
</template>

<script>
export default {
  data () {
    return {
      formInline: {
        user: '',
        password: ''
    },
      ruleInline: {
        user: [
          { required: true, message: 'Please fill in the user name', trigger: 'blur' }
          ],
        password: [
          { required: true, message: 'Please fill in the password.', trigger: 'blur' },
          { type: 'string', min: 6, message: 'The password length cannot be less than 6 bits', trigger: 'blur' }
          ]
      }
    }
  },
  components: {
  },
  mounted () {
  },
  methods: {
    handleSubmit(name) {
      this.$refs[name].validate((valid) => {
          if (valid) {
              this.$Message.success('Success!');
          } else {
              this.$Message.error('Fail!');
          }
      })
    }
  }
}
</script>

<style scoped="scoped">
  @import url("../assets/index.css");
  .bg {
    width: 100%;
    height: 100%;
    background-image: url('https://cdn.51bolema.com/img/bolema_teacher_login_background_img_1.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  .login {
    width: 743.75px;
    height: 397.25px;
    border: 1px;
    border-radius: 19px;
    display: flex;
    background-color: #fff;
    margin-top: -190px;
    margin-left: -375px;
    padding: 25px;
    position: absolute;
    left: 50%;
    top: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
  }
  .login-bg {
    width: 50%;
    height: 100%;
    background-image: url('https://cdn.51bolema.com/img/bolema_class_default.jpg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border-radius: 19px;
    box-shadow: 1px 1px 3px 0 rgba(0,0,0,0.15);
  }
  .login-body {
    width: 44%;
    height: 100%;
    margin-left: 6%;
    align-items: center;
    flex-direction: column;
    display: flex;
  }
  .login-title {
    color: #2d8cf0;
    font-size: 21px;
  }
  .login-form {
    width: 100%;
    height: auto;
  }

  .userbody {
    width: 100%;
    height: 40px;
    border: 1px solid;
    border-radius: 25px;
    margin-top: 27px;
  }
  .user {
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
  }
  .userinputs {
    width: 235px;
    border: none;
    outline: none;
  }
  .usericon {
    color: #2D8CF0;
    font-size: 25px;
  }

  .passwordbody {
    width: 100%;
    height: 40px;
    border: 1px solid;
    border-radius: 25px;
    margin-top: 27px;
  }
  .password {
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
  }
  .passwordinputs {
    width: 235px;
    border: none;
    outline: none;
  }
  .passwordicon {
    color: #2D8CF0;
    font-size: 25px;
  }
  .remember {
    font-size: 13px;
  }
  .loginbtn {
    width: 100%;
    height: 40px;
    border-radius: 25px;
    position: absolute;
    top: -10px;
  }
  .ty{
    margin-top: 5px;
    font-size: 13px;
  }
  .form {
    position: absolute;
    top: -10px;
  }
  .google {
    display: inline-block;
  }
  .firefox {
    display: inline-block;
  }
  .version {
    color: #FFFFFF;
    font-size: 12px;
    position: fixed;
    bottom: 0px;
    left: 50%;
    margin-left: -200px;
  }
</style>
<style>
 .ivu-input{
    border: none!important;
  }
</style>
